no-issue: Infer types in place of Class<T> on Steps interface#1223
no-issue: Infer types in place of Class<T> on Steps interface#1223fjtirado merged 2 commits intoserverlessworkflow:mainfrom
Class<T> on Steps interface#1223Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the fluent Func DSL Step chaining API to infer lambda input types at runtime (instead of requiring Class<T> arguments), and adjusts executor tests to use the inferred-type overloads.
Changes:
- Update
Stepchaining methods (when,exportAs,outputAs,inputFrom) to useReflectionUtils.inferInputType(...)and pass inferred classes into the underlying builders. - Switch several
Stepoverloads to accept serializable functional interfaces to enableSerializedLambda-based inference. - Update data-flow transformation helper tests to remove explicit
Class<T>parameters and add explicit lambda parameter types where needed.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| experimental/lambda/src/test/java/io/serverless/workflow/impl/executors/func/FuncDSLDataFlowTransformationHelpersTest.java | Updates tests to use inferred-type DSL overloads and explicitly typed lambda parameters for context-aware functions. |
| experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/Step.java | Adds runtime type inference for chained transformations/conditions and updates method signatures to use serializable functional interfaces. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/Step.java
Show resolved
Hide resolved
experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/Step.java
Show resolved
Hide resolved
experimental/fluent/func/src/main/java/io/serverlessworkflow/fluent/func/dsl/Step.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@ricardozanini I tried to resolve the merge conflict to save you work, but I broke it (missing imports) and also we need the DCO. Sorry about that |
Signed-off-by: Ricardo Zanini <ricardozanini@gmail.com>
Signed-off-by: Ricardo Zanini <ricardozanini@gmail.com>
dbc7c47 to
ae62455
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -47,8 +47,11 @@ protected SELF self() { | |||
| // --------------------------------------------------------------------------- | |||
|
|
|||
| /** Queue a {@code when(predicate)} to be applied on the concrete builder. */ | |||
| */ | ||
| public <T, V> SELF exportAs(Function<T, V> function) { | ||
| postConfigurers.add(b -> ((FuncTaskTransformations<?>) b).exportAs(function)); | ||
| public <T, R> SELF exportAs(SerializableFunction<T, R> function) { |
| */ | ||
| public <T, V> SELF outputAs(Function<T, V> function) { | ||
| postConfigurers.add(b -> ((FuncTaskTransformations<?>) b).outputAs(function)); | ||
| public <T, R> SELF outputAs(SerializableFunction<T, R> function) { |
| */ | ||
| public <T, V> SELF inputFrom(Function<T, V> function) { | ||
| postConfigurers.add(b -> ((FuncTaskTransformations<?>) b).inputFrom(function)); | ||
| public <T, R> SELF inputFrom(SerializableFunction<T, R> function) { |
Many thanks for submitting your Pull Request ❤️!
What this PR does / why we need it:
We missed the transformation interfaces inference on the other PR (#1219)
Special notes for reviewers:
Additional information (if needed):